#
# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=CvtePrebuilt
PKG_VERSION:=1.0
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(COMPILE_DIR)/$(PKG_NAME)
HAVE_SOURCE := yes

include $(BUILD_DIR)/package.mk

define Package/$(PKG_NAME)
  SUBMENU:=0_Resource
  SECTION:=0_Resource
  CATEGORY:=CVTE
  DEPENDS:= +CvteGlobalHeaderFile \
            +libminigui-gpl +libmgplus +libmgeff +tslib \
            +btmanager +btmanager-core +wifimanager \
            +libuapi +libcedarx +alsa-utils \
            +tinyalsa +tinyalsa-lib +qrencode \
            +libev \
            +libcrypto +libopenssl +libcurl \
            +libubox +libubus \
            +libuclient
  TITLE:=CVTE_Prebuilt
  MAINTAINER:=CVTE_ZXL<zhangxianglong@cvte.com>
endef

define Package/$(PKG_NAME)/description
  The prebuilt resource from CVTE
endef

define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)/
	$(CP) -r ./src/* $(PKG_BUILD_DIR)/
endef

define Build/Compile
endef

define Build/InstallDev
	$(INSTALL_DIR) $(1)/usr/include/cvte
	$(INSTALL_DIR) $(1)/usr/lib

	$(CP) $(PKG_BUILD_DIR)/include/* $(1)/usr/include/cvte
	$(CP) $(PKG_BUILD_DIR)/mnt/app/lib/*.so $(1)/usr/lib
endef

define Package/$(PKG_NAME)/install
	$(INSTALL_DIR) $(1)/mnt

	$(CP) -r $(PKG_BUILD_DIR)/mnt/* $(1)/mnt/
endef

$(eval $(call BuildPackage,$(PKG_NAME)))
